<?php

declare(strict_types = 1);

namespace App\Model;

use Hyperf\Scout\Searchable;

/**
 * @property int    $id
 * @property string $name
 * @property string $imei
 * @property int    $scene_id
 * @property int    $client_id
 * @property string $start_date
 * @property string $end_date
 * @property int    $number
 * @property int    $status
 * @property int    $bind_status
 * @property string $untie_at
 * @property string $create_at
 * @property string $update_at
 */
class User extends Model
{

    use Searchable;

    /**
     * The table associated with the model.
     */
    protected ?string $table = 'user';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'name', 'imei', 'scene_id', 'client_id', 'start_date', 'end_date', 'number', 'status', 'bind_status', 'untie_at', 'create_at', 'update_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'scene_id' => 'integer', 'client_id' => 'integer', 'number' => 'integer', 'status' => 'integer', 'bind_status' => 'integer'];

    /**
     * Get the index name for the model.
     *
     * @return string
     */
    public function searchableAs(): string
    {
        return 'user_index';
    }

    /**
     * Get the indexable data array for the model.
     *
     * @return array
     */
    public function toSearchableArray(): array
    {
        return $this->toArray();
    }
}
